<?php
namespace App\Admin\Models;
use App\Base\Models\BaseModel;
/**
 * Created by 荣耀电竞.
 * User: 林子彦 <278805354@qq.com>
 * Date: 2018/5/17 0017
 * Time: 17:33
 */
class  MemberModel extends  BaseModel {
    public $table="member";
    public $timestamps=true;
    /**
     * The name of the "created at" column.
     *
     * @var string
     */
    const CREATED_AT = 'create_time';  //修改添加时间字段
    protected $appends = ['last_login_date','last_ip'];
    /**
     * The name of the "updated at" column.
     *
     * @var string
     */
    const UPDATED_AT = 'update_time';
    /**
     * 模型的日期字段保存格式。
     */
    protected $dateFormat = 'U';

    //时间戳转
    public function getLastLoginDateAttribute(){
        return date("Y-m-d",$this->last_login_time);
    }
    public function getLastIpAttribute(){

       return long2ip($this->last_login_ip);
    }
}